﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MinuyTools : MonoBehaviour
{
        /// <summary>
        /// 时间类型转长整型
        /// </summary>
        /// <param name="time">时间</param>
        /// <returns>时间戳</returns>
        public static long ConvertDateTimeToLong(System.DateTime time)
        {
                System.DateTime startTime = System.TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
                return (long)(time - startTime).TotalSeconds;
        }

        public static long Timestamp()
        {
                return (System.DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000;
        }
}
